home *** CD-ROM | disk | FTP | other *** search
- This is the Readme.txt file for the component
- TAccumulator contained within Accum.pas.
-
- {*******************************}
- { Author: Eric Uber }
- { CIS Account: 71102,3034 }
- { Written: June 14th 1995. }
- { Freeware, distribute at will. }
- {*******************************}
-
- Description: TAccumulator is a Non-Visual component that
- provides various methods for the accumulation
- of ordinal values.
-
- Where you may normally declare a variable and
- increment its value...
-
- Ex. i := i+1; OR Inc(i);
-
- using this component
-
- Accumulator1.Add(1); OR Accumulator1.Inc;
-
- The advantage of using this component
- in the above example is you droped the accumulator
- on the form opposed to declaring a var. The
- component however gives the accumulator the scope
- of an object as well as the protection of an object.
-
- The TAccumulator component has methods for
-
- * incrementing
- * Decrementing
- * Adding
- * Subtracting
- * Dividing
- * Resetting accumulator
-
- Each of these are describe in this readme file.
-
- The TAccumulator component has several events that
- execute just PRIOR to the computation: Being able to
- encapsulate code that fires upon a computation
- begins to show the power of this component. The
- events are:
-
- * OnInc
- * OnDec
- * OnAdd
- * OnSubtract
- * OnDivide
- * OnMultiply
-
- The TAccumulator component has several properties.
- They are:
-
- * property StartValue { Self explainatory }
- * property MaxValue { Ignored if 0 }
- * property ExceptOnMaxValExceed:
-
- If ExceptOnMaxValExceed is set to true, and any
- of the Methods are called that result in the
- accumulator value exceeding MaxValue then an
- exception is raise. You can capture this exception
- using try..Except blocks.
-
- The most powerful implimentaion of the component
- is when an array of pointers to the component is
- used in your code or if the component is made a
- member of another component.
-
- The following is the Method information...
-
- {----------------------------------------------------------}
- { Public Method: function TAccumulator.AccInc: LongInt; }
-
- { Purpose: Increments the accumulators current value. }
-
- { Returns: Result of computation or 0 (if }
- { ExceptOnMaxValExceed is set to False and result }
- { exceeds MaxValue). If ExceptOnMaxValExceed }
- { is set to true and the result exceeds MaxValue, }
- { an exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: function TAccumulator.AccDec: LongInt; }
-
- { Purpose: Decrements the accumulators current value. }
-
- { Returns: Result of computation or 0 (if }
- { ExceptOnMaxValExceed is set to False and result }
- { exceeds MaxValue). If ExceptOnMaxValExceed }
- { is set to true and the result exceeds MaxValue, }
- { an exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: Add(liInValue: LongInt): LongInt; }
-
- { Purpose: Adds the value passed in Param1 to Accumulator }
-
- { Returns: Result of computation or 0 (if }
- { ExceptOnMaxValExceed is set to False and result }
- { exceeds MaxValue). If ExceptOnMaxValExceed }
- { is set to true and the result exceeds MaxValue, }
- { an exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: function TAccumulator.Subtract( }
- { liInValue: LongInt): LongInt; }
-
- { Purpose: Sets the Accumulator to the result of its }
- { (current value - Param1). }
-
- { Returns: Result of computation or 0 (if }
- { ExceptOnMaxValExceed is set to False and result }
- { exceeds MaxValue). If ExceptOnMaxValExceed }
- { is set to true and the result exceeds MaxValue, }
- { an exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: function TAccumulator.Multiply( }
- { liInValue: LongInt): LongInt; }
-
- { Purpose: Sets the Accumulator to the result of its }
- { current value * Param1. }
-
- { Returns: Result of computation or 0 (if }
- { ExceptOnMaxValExceed is set to False and result }
- { exceeds MaxValue). If ExceptOnMaxValExceed }
- { is set to true and the result exceeds MaxValue, }
- { an exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: function TAccumulator.Divide( }
- { liInValue: LongInt ): LongInt; }
-
- { Purpose: Sets the Accumulator to the result of its }
- { current value DIV Param1. }
-
- { Returns: Result of computation or 0 (if }
- { ExceptOnMaxValExceed is set to False and result }
- { exceeds MaxValue). If ExceptOnMaxValExceed }
- { is set to true and the result exceeds MaxValue, }
- { an exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: function GetCurrentValue: LongInt; }
-
- { Purpose: To retrieve the accumulators current value. }
-
- { Returns: The Accumulators current value. If }
- { ExceptOnMaxValExceed is set to true and the }
- { Accumulators current value exceeds MaxValue, an }
- { exception called EMaxExceedError will occur. }
- {----------------------------------------------------------}
-
- {----------------------------------------------------------}
- { Public Method: procedure TAccumulator.Reset; }
-
- { Purpose: Resets Accumulator to value of StartValue }
-
- { Returns: Nothing. This is a procedure. }
- {----------------------------------------------------------}
-
-
-
- {----------------------------------------------------------}
- Please report suggestions or bugs to...
- Author: Eric Uber
- CIS Account: 71102,3034
- {----------------------------------------------------------}